package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) CrontabList(ctx context.Context, req *system.CrontabListReq) (res *system.CrontabListRes, err error) {
	res = new(system.CrontabListRes)
	res.List, res.Total, err = service.SystemCrontab().List(ctx, model.CrontabListInput{
		Page:       req.Page,
		PageSize:   req.PageSize,
		Name:       req.Name,
		Title:      req.Title,
		CategoryId: req.CategoryId,
	})
	return
}
